

package util.encrypt;

import util.file.FileUtil;



//http://stackoverflow.com/questions/20227/how-do-i-use-3des-encryption-decryption-in-java
public class CriptoTripleDESBasicoTest {
    public static void main(String[] args) throws Exception {

        CriptoTripleDESBasico crip = new CriptoTripleDESBasico("123");
        
    	String text1 = "!#$%&/()=?¿¡áéíóúñÑ<>-_{}[]^¨ü@";
        String text2 = "ENAHO WEB";
        String text3 = "ENAHO XML";

        //byte[] key = new byte[]{1,2,3};
    	byte[] codedtext;
        codedtext = crip.encryptToBytes(text1);
    	String decodedtext1 = crip.decrypt(codedtext);
        
    	codedtext = crip.encryptToBytes(text2);
    	String decodedtext2 = crip.decrypt(codedtext);
        
    	codedtext = crip.encryptToBytes(text3);
    	String decodedtext3 = crip.decrypt(codedtext);
        
        System.out.write(codedtext);
        System.out.println("");
    	System.out.println(decodedtext1); // This correctly shows "kyle boon"
    	System.out.println(decodedtext2); // This correctly shows "kyle boon"
    	System.out.println(decodedtext3); // This correctly shows "kyle boon"
        FileUtil.escribirArchivo("d:/cripto.txt", codedtext);
    }

    
}
